#ifndef UI_PENTOOLBAR_H
#define UI_PENTOOLBAR_H

#include <qtoolbar.h>

#include "pf_layerlistobserver.h"
#include "pf_pen.h"

#include "ui_colorbox.h"
#include "ui_widthbox.h"
#include "ui_linetypebox.h"
#include "gui_export.h"

/**
 * A toolbar that offers all widgets for choosing a pen.
 */
class GUI_EXPORT UI_PenToolBar: public QToolBar,
    public PF_LayerListObserver {
    Q_OBJECT

public:
	UI_PenToolBar( const QString & title, QWidget * parent = 0 );
    virtual ~UI_PenToolBar();

    PF_Pen getPen() {
        return currentPen;
    }

    // Methods from PF_LayerListObserver Interface:
    virtual void layerActivated(PF_Layer*);
    virtual void layerEdited(PF_Layer*);

public slots:
    void slotColorChanged(const PF_Color& color);
    void slotWidthChanged(LX_Define::LineWidth w);
    void slotLineTypeChanged(LX_Define::LineType w);

signals:
    void penChanged(PF_Pen);

private:
    PF_Pen currentPen;
    UI_ColorBox* colorBox;
    UI_WidthBox* widthBox;
    UI_LineTypeBox* lineTypeBox;
};

#endif
